Use gtk_aspect_frame_set_child throughout
authorMatthias Clasen <mclasen@redhat.com>
Fri, 1 May 2020 18:53:55 +0000 (14:53 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 4 May 2020 21:01:18 +0000 (17:01 -0400)
Replace all uses of gtk_container_add on aspect frames
by gtk_aspect_frame_set_child.

demos/gtk-demo/sliding_puzzle.c

index 2c8abf8ac73ed4c83c7c39b2f3224b09f0f2a1cf..82442b4b5469bd6c4fbdaeb6886a5d34262fadc6 100644 (file)
@@ -270,12 +270,12 @@ start_puzzle (GdkPaintable *paintable)
   /* Remove the old grid (if there is one) */
   grid = gtk_bin_get_child (GTK_BIN (frame));
   if (grid)
-    gtk_container_remove (GTK_CONTAINER (frame), grid);
+    gtk_aspect_frame_set_child (GTK_ASPECT_FRAME (frame), NULL);
 
   /* Create a new grid */
   grid = gtk_grid_new ();
   gtk_widget_set_can_focus (grid, TRUE);
-  gtk_container_add (GTK_CONTAINER (frame), grid);
+  gtk_aspect_frame_set_child (GTK_ASPECT_FRAME (frame), grid);
   aspect_ratio = gdk_paintable_get_intrinsic_aspect_ratio (paintable);
   if (aspect_ratio == 0.0)
     aspect_ratio = 1.0;